package com.archtecture.control.models;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.spgf.control.models.Lancamento;

/**
 * The persistent class for the usuario database table.
 * 
 */
@Entity
@Table(name = "usuario")
public class Usuario extends ModelAb implements Serializable {

	/**
	 * 
	 */
	private static final long	serialVersionUID	= -8730866048394302913L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "CODIGO")
	private Integer				codigo;

	@Column(name = "LOGIN")
	private String				login;

	@Column(name = "NOME")
	private String				nome;

	@Column(name = "SENHA")
	private String				senha;

	// bi-directional many-to-one association to Lancamento
	@OneToMany(mappedBy = "usuario")
	private List<Lancamento>	lancamentos;

	public Usuario() {}

	@Override
	public String[] getAtributosOrdencao() {
		return new String[] {"codigo"};
	}

	public List<Lancamento> getLancamentos() {
		return lancamentos;
	}

	@Override
	public Integer getCodigo() {
		return codigo;
	}

	public String getLogin() {
		return login;
	}

	public String getNome() {
		return nome;
	}

	public String getSenha() {
		return senha;
	}

	public void setLancamentos(List<Lancamento> lancamentos) {
		this.lancamentos = lancamentos;
	}

	public void setCodigo(Integer codigo) {
		this.codigo = codigo;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public void setSenha(String senha) {
		this.senha = senha;
	}

}